import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
let router = new Router({
  mode: 'history',
  routes: [
    {
      path: '/404',
      component: (resolve) => require(['@/views/error/404'], resolve),
      hidden: true
    },
    {
      path: '/jiayou',
      name: '加油功能',
      component: () => import('@/views/jiayou/index')
    },
    {
      path: '/jiayou/config',
      name: '油价设定',
      component: () => import('@/views/jiayou/config')
    },
    {
      path: '/jiayou/jiayou',
      name: '加油',
      component: () => import('@/views/jiayou/jiayou')
    },
    {
      path: '/jiayou/record',
      name: '车辆管理',
      component: () => import('@/views/jiayou/record')
    },
    {
      path: '/my/income',
      name: '我的收入',
      component: () => import('@/views/my/income')
    },
    {
      path: '/projectSettings/settingOfDump',
      name: '倒土场',
      component: () => import('@/views/projectSettings/settingOfDump')
    },
    {
      path: '/projectSettings/createProject',
      name: '倒土场',
      component: () => import('@/views/projectSettings/createProject')
    },
    {
      path:'/vehicleinfo',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/VehicleInformation')
    },
    {
      path:'/vehiclelist',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/VehicleList')
    },
    {
      path:'/totalcost',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/totalCost')
    },
    {
      path:'/mechanical/vehicle',
      name:'车型管理',
      component:()=>import('@/views/mechanical/vehicle')
    },
    {
      path:'/mechanical/project',
      name:'项目部',
      component:()=>import('@/views/mechanical/project')
    },
    {
      path:'/mechanical/maintenances',
      name:'维修订单',
      component:()=>import('@/views/mechanical/maintenances')
    },
    {
      path:'/mechanical/maintain',
      name:'维修订单',
      component:()=>import('@/views/mechanical/maintain')
    },
    {
      path:'/mechanical/importdata',
      name:'数据录入',
      component:()=>import('@/views/mechanical/importdata')
    },
    {
      path:'/mechanical/inputData',
      name:'数据录入',
      component:()=>import('@/views/mechanical/inputData')
    },
    {
      path:'/mechanical/beverage',
      name:'酒水车',
      component:()=>import('@/views/mechanical/beverage')
    },
    {
      path:'/register/picture',
      component:()=>import('@/views/register/picture')
    },
    {
      path:'/other/Individua',
      name:'个人土方运输',
      component:()=>import('@/views/other/Individua')
    },
    {
      path:'/other/otherCosts',
      name:'其他成本',
      component:()=>import('@/views/other/otherCosts')
    },
    {
      path:'/other/driver',
      name:'司机工资',
      component:()=>import('@/views/other/driver')
    },
    {
      path:'/other/total',
      name:'机械总成本',
      component:()=>import('@/views/other/total')
    },
    {
      path:'/other/maintenance',
      name:'维修成本',
      component:()=>import('@/views/other/maintenance')
    },
    {
      path:'/other/projectManagement',
      name:'项目管理',
      component:()=>import('@/views/other/projectManagement')
    },
    {
      path:'/other/projectStatistics',
      name:'项目统计',
      component:()=>import('@/views/other/projectStatistics')
    },
    {
      path:'/other/projectDetails',
      name:'项目详情',
      component:()=>import('@/views/other/projectDetails')
    },
    {
      path:'/other/projectDetailsCopy',
      name:'项目详情',
      component:()=>import('@/views/other/projectDetailsCopy')
    },
    {
      path:'/shenHe/personnelAudit',
      name:'人员审核',
      component:()=>import('@/views/shenHe/personnelAudit')
    },
    {
      path:'/shenHe/auditFailed',
      name:'人员审核',
      component:()=>import('@/views/shenHe/auditFailed')
    },
    {
      path:'/home/homePage',
      name:'炳圣建工',
      component:()=>import('@/views/home/homePage')
    },
    {
      path:'/home/homePages',
      name:'炳圣建工',
      component:()=>import('@/views/home/homePages')
    },
    {
      path:'/denglu/company',
      name:'加入公司',
      component:()=>import('@/views/denglu/company')
    },
    {
      path:'/denglu/companys',
      name:'加入公司',
      component:()=>import('@/views/denglu/companys')
    },
    {
      path: '/my/income',
      name: '我的收入',
      component: () => import('@/views/my/income')
    },
    {
      path: '/projectSettings/settingOfDump',
      name: '倒土场',
      component: () => import('@/views/projectSettings/settingOfDump')
    },
    {
      path: '/projectSettings/createProject',
      name: '倒土场',
      component: () => import('@/views/projectSettings/createProject')
    },
    {
      path:'/vehicleinfo',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/VehicleInformation')
    },
    {
      path:'/vehiclelist',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/VehicleList')
    },
    {
      path:'/totalcost',
      name:'车辆管理',
      component:()=>import('@/views/projectManage/totalCost')
    },
    {
      path: '/franchiseVehicleEntry/Information',
      name: '',//注册
      component: () => import('@/views/franchiseVehicleEntry/Information')
    },
    {
      path: '/my/changePassword',
      name: '修改密码',
      component: () => import('@/views/my/changePassword')
    },
    {
      path: '/franchiseVehicleEntry/Mycar1',
      name: '我的车辆',
      component: () => import('@/views/franchiseVehicleEntry/Mycar1')
    },
    {
      path: '/search/history',
      // name: '我的车辆',
      component: () => import('@/views/search/history')
    },
    {
      path: '/search/search-result',
      name: '我的车辆',
      component: () => import('@/views/search/search-result')
    },
    {
      path: '/projectSettings/Transport_price',
      name: '项目运费设置',
      component: () => import('@/views/projectSettings/Transport_price')
    },
    {
      path: '/projectSettings/Transport_priceCopy',
      name: '新增',
      component: () => import('@/views/projectSettings/Transport_priceCopy')
    },
    {
      path: '/projectSettings/positioning',
      name: '定位',
      component: () => import('@/views/projectSettings/positioning')
    },
    {
      path: '/projectSettings/satellitePositioning',
      name: '卫星定位',
      component: () => import('@/views/projectSettings/satellitePositioning')
    },
    {
      path: '/franchiseVehicleEntry/fillInInformation',
      name: '加盟汽车信息录入',
      component: () => import('@/views/franchiseVehicleEntry/fillInInformation')
    },
    {
      path: '/my/mycars',
      name: '我的车辆',
      component: () => import('@/views/my/mycars')
    },
    {
      path: '/my/incomes',
      name: '我的收入',
      component: () => import('@/views/my/incomes')
    },
    {
      path: '/loginRegistration/passwordLogin',
      name: '',
      component: () => import('@/views/loginRegistration/passwordLogin')
    },
    {
      path: '/loginRegistration/signIn',
      name: '',
      component: () => import('@/views/loginRegistration/signIn')
    },
    {
      path: '/franchiseVehicleEntry/registerRole',
      name: '',
      component: () => import('@/views/franchiseVehicleEntry/registerRole')
    },
    {
      path: '/loginRegistration/Information',
      name: '',
      component: () => import('@/views/loginRegistration/Information')
    },
    {
      path: '/loginRegistration/joinTheCompany',
      name: '加入公司',
      component: () => import('@/views/loginRegistration/joinTheCompany')
    },
    {
      path: '/loginRegistration/Individuals',
      name: '',//个人界面
      component: () => import('@/views/loginRegistration/Individuals')
    },
    {
      path: '*', // 此处需特别注意置于最底部
      redirect: '/404'
    },
  ]
})

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

export default router
